package 强化训练;

import java.util.Scanner;

public class 走方格的方案 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = 0;
        int b = 0;
//        while(sc.hasNextLine()){
            a = sc.nextInt();
            b = sc.nextInt();
//        }
        int[][] arr = new int[a+1][b+1];
        System.out.println(count(arr, 0, 0));
    }
    private static int count(int[][] arr,int i ,int j){
        int a = arr.length;
        int b = arr[0].length;
        if(i == arr.length - 1 && j == arr[0].length - 1) return 1;
        int p1 = 0;
        int p2 = 0;
        if(i >= a && j < b || i < a && j >= b) return 0;
        if(i >= a - 1){
            //只能向右
            p1 = count(arr,i,j+1);
        }else if(j >= b - 1){
            //只能向下走
            p2 = count(arr,i+1,j);
        }else{
            //向下走
            p2 = count(arr,i+1,j);
            //向右走
            p1 = count(arr,i,j+1);
        }
        return p1 + p2;
    }
}
